package com.gopay.common.constants.fund.rtfund;

/**
 * 活期宝开户申请状态
 * 开户状态：0-已入库，1-TA审核中，2-开户成功，3-TA确认失败
 * @author yu_liu6@hnair.com
 * @date 2017-12-12 14:52:23
 */
public enum FundpOpenAccStatusEnum {

    INITIAL("A","已入库"),
    TA_CONFIRMING("2","已上报TA待TA确认"),
    APPROVE_SUCCESS("3","TA确认成功"),
    DESTROY("4","已销户"),
    WAIT_REPORT_TA("5","待上报TA"),
    TA_CONFIRM_FAILURE("6","TA确认失败"),
    OTHERS("7","其他");

    private String code;
    private String desc;

    FundpOpenAccStatusEnum(String code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static FundpOpenAccStatusEnum getEnumByCode(String code){
        for (FundpOpenAccStatusEnum status : FundpOpenAccStatusEnum.values()) {
            if(status.getCode().equals(code)){
                return status;
            }
        }
        return FundpOpenAccStatusEnum.OTHERS;
    }
}
